<!doctype html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link href="css/mui.min.css" rel="stylesheet" />
	</head>

	<body>
		<h1>我的</h1>
		<div class="mui-content">
			<ul class="mui-table-view">
				<li class="mui-table-view-cell mui-media">
					<a id="a_myface" href="javascript:;">
						<span class="mui-pull-right mui-icon mui-icon-arrowright" style="line-height: 42px;color:lightgray;margin-left: 3px;"></span>
						<img id="img_myface" class="mui-media-object mui-pull-right" src="image/face-default-cat.png">
						<div class="mui-media-body">
							头像
							<p class="mui-ellipsis">能和心爱的人一起睡觉，是件幸福的事情；可是，打呼噜怎么办？</p>
						</div>
					</a>
				</li>
				<li class="mui-table-view-cell mui-media">
					<a href="javascript:;">
						<span class="mui-pull-right mui-icon mui-icon-arrowright" style="color:lightgray;margin-left: 3px;"></span>
						<span id="nickname" class="mui-pull-right" style="color: gray;font-size: 14px;padding-top: 2px;">莫兰蒂</span>
						<div class="mui-media-body">
							昵称
						</div>
					</a>
				</li>
				<li class="mui-table-view-cell mui-media">
					<a href="javascript:;">
						<span class="mui-pull-right mui-icon mui-icon-arrowright" style="color:lightgray;margin-left: 3px;visibility:hidden;"></span>
												<span id="username" class="mui-pull-right" style="color: gray;font-size: 14px;padding-top: 2px;">Marandi</span>
						<div class="mui-media-body">
							账号
						</div>
					</a>
				</li>
				<li class="mui-table-view-cell mui-media">
					<a href="javascript:;">
						<span class="mui-pull-right mui-icon mui-icon-arrowright" style="color:lightgray;margin-left: 3px;"></span>
						<img class="mui-media-object mui-pull-right" src="image/qrcode.png"
							style="max-width: 20px;height: 20px;">
						<div class="mui-media-body">
							二维码
						</div>
					</a>
				</li>
			</ul>
			<br />
			
			<ul class="mui-table-view">
				<li class="mui-table-view-cell mui-media" style="text-align: center;">
					<a href="javascript:;">
						
						<div class="mui-media-body">
							退出登录
						</div>
					</a>
				</li>
			</ul>
		</div>

		<script src="js/mui.min.js"></script>
		<script type="text/javascript" src="js/app.js" ></script>
		<script type="text/javascript">
			mui.init();
			mui.plusReady(function(){
				let webview = plus.webview.currentWebview();
				webview.addEventListener("show",function(){
					refreshUserInfo();
				});
				let a_myface = document.getElementById("a_myface");
				a_myface.addEventListener("tap",function(){
					mui.openWindow("myface.html","myface")
				});
			});
			function refreshUserInfo(){
				let user = app.getGlobalUserInfo();
				let faceimage = user.faceImage;
				let username = user.username;
				let nickname = user.nickname;
				
				let span_username = document.getElementById("username");
				let span_nickname = document.getElementById("nickname");
				span_username.innerHTML = username;
				span_nickname.innerHTML = nickname;
				
				if(app.isNotNull(faceimage)){
					let myfaceimg = document.getElementById("img_myface");
					myfaceimg.src = app.imgServerUrl + faceimage;
				}
			}
		</script>
	</body>

</html>